3.969 \(\int (1-x)^n (1+x)^{-n} \, dx\)

Optimal. Leaf size=38 \[ -\frac{2^{-n} (1-x)^{n+1} \, _2F_1\left (n,n+1;n+2;\frac{1-x}{2}\right )}{n+1} \]

[Out]

-(((1 - x)^(1 + n)*Hypergeometric2F1[n, 1 + n, 2 + n, (1 - x)/2])/(2^n*(1 + n)))

_______________________________________________________________________________________

Rubi [A]  time = 0.0223566, antiderivative size = 38, normalized size of antiderivative = 1., number of steps used = 1, number of rules used = 1, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.067 \[ -\frac{2^{-n} (1-x)^{n+1} \, _2F_1\left (n,n+1;n+2;\frac{1-x}{2}\right )}{n+1} \]

Antiderivative was successfully verified.

[In]  Int[(1 - x)^n/(1 + x)^n,x]

[Out]

-(((1 - x)^(1 + n)*Hypergeometric2F1[n, 1 + n, 2 + n, (1 - x)/2])/(2^n*(1 + n)))

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 3.48828, size = 26, normalized size = 0.68 \[ - \frac{2^{- n} \left (- x + 1\right )^{n + 1}{{}_{2}F_{1}\left (\begin{matrix} n, n + 1 \\ n + 2 \end{matrix}\middle |{- \frac{x}{2} + \frac{1}{2}} \right )}}{n + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((1-x)**n/((1+x)**n),x)

[Out]

-2**(-n)*(-x + 1)**(n + 1)*hyper((n, n + 1), (n + 2,), -x/2 + 1/2)/(n + 1)

_______________________________________________________________________________________

Mathematica [A]  time = 0.028162, size = 40, normalized size = 1.05 \[ -\frac{2^n (x+1)^{1-n} \, _2F_1\left (1-n,-n;2-n;\frac{x+1}{2}\right )}{n-1} \]

Antiderivative was successfully verified.

[In]  Integrate[(1 - x)^n/(1 + x)^n,x]

[Out]

-((2^n*(1 + x)^(1 - n)*Hypergeometric2F1[1 - n, -n, 2 - n, (1 + x)/2])/(-1 + n))

_______________________________________________________________________________________

Maple [F]  time = 0.088, size = 0, normalized size = 0. \[ \int{\frac{ \left ( 1-x \right ) ^{n}}{ \left ( 1+x \right ) ^{n}}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((1-x)^n/((1+x)^n),x)

[Out]

int((1-x)^n/((1+x)^n),x)

_______________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \[ \int{\left (x + 1\right )}^{-n}{\left (-x + 1\right )}^{n}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((-x + 1)^n/(x + 1)^n,x, algorithm="maxima")

[Out]

integrate((x + 1)^(-n)*(-x + 1)^n, x)

_______________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \[{\rm integral}\left (\frac{{\left (-x + 1\right )}^{n}}{{\left (x + 1\right )}^{n}}, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((-x + 1)^n/(x + 1)^n,x, algorithm="fricas")

[Out]

integral((-x + 1)^n/(x + 1)^n, x)

_______________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((1-x)**n/((1+x)**n),x)

[Out]

Timed out

_______________________________________________________________________________________

GIAC/XCAS [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{{\left (-x + 1\right )}^{n}}{{\left (x + 1\right )}^{n}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((-x + 1)^n/(x + 1)^n,x, algorithm="giac")

[Out]

integrate((-x + 1)^n/(x + 1)^n, x)